<?
	session_start();
	require_once ($_SERVER['DOCUMENT_ROOT']."/control/config.php");
	
	$connectionstring = ConnectMainDatabase();
	
	$matvv = $_SESSION['matvv'];
	
//	$query = " INSERT INTO history VALUES('now()', '$user', 'logout' ,'') ";
//	$queryexe = odbc_do($connectionstring, $query);
//	
//	odbc_fetch_row($queryexe);
	
	unset($_SESSION['matvv']);
	unset($_SESSION['matkhau']);
	unset($_SESSION['trangthai']);
	
	session_unset();
	session_destroy();
	
	CloseMainDatabase($connectionstring);
	
	URL_forward("/index.php", "5");
	exit();
?>